package com.bmps.springcloud.insuredmicroservice.service.underwrite.strategy.riskamount;

import com.bmps.springcloud.insuredmicroservice.model.accept.medium.PolicyRiskInfoModel;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * description:
 * HCT007风险保额
 * 未成年 保额*2，否则 取保额
 *
 * @author jackdaw
 * @date 2020-04-16 18:41
 */
@Component
public class Hct007Strategy implements InsuranceRiskAmountStrategy {
    @Override
    public BigDecimal getRiskAmount(PolicyRiskInfoModel policyRiskInfoModel, boolean isCurrent, Object object) {

        return policyRiskInfoModel.getInsuredAppAge() <= 17 ? policyRiskInfoModel.getAmnt().multiply(BigDecimal.valueOf(2)) :
                policyRiskInfoModel.getAmnt();
    }
}
